package alibobo.util.io.path;

import java.io.File;
import java.util.ArrayList;
import java.util.List;

public class PathSplit {

	public String path;
	public String name;
	public String postFix;

	boolean isfile = false;

	public boolean IsFile() {
		return isfile;
	}

	public List<String> getSegment() {
		List<String> rr = new ArrayList<String>();

		return rr;
	}

	public PathSplit() {

	}

	
	public PathSplit(String fileName) {
		File f = new File(fileName);
		postFix="";
		name="";

		
		if (f.isFile()) {
			isfile = true;
			int pos = fileName.lastIndexOf(".");
			postFix = fileName.substring(pos + 1);
			int p1 = fileName.lastIndexOf("\\");
			path = fileName.substring(0, p1 + 1);
			name = fileName.substring(p1 + 1, pos);
			return;
		}
	}

	public void print() {
		System.out.println(path);
		System.out.println(name);
		System.out.println(postFix);

	}

}
